package com.rockcent.mall.lib.helper;

import com.rockcent.mall.lib.domain.Template;
import com.rockcent.mall.lib.domain.enumclass.TemplateType;
import com.rockcent.mall.lib.dto.TemplateDto;
import org.springframework.stereotype.Component;

/**
 * Created by zhangjh on 2016/11/16.
 */
@Component
public class TemplateHelper {


    public Template chgCtoToDomain(TemplateDto dto) {
        Template template = new Template();
        template.setTitle(dto.getTitle());
        template.setContent(dto.getContent());
        template.setType(TemplateType.valueOf(dto.getType()));

        return template;

    }
}
